home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10300 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.3 KB  |  82 lines

  1. Path: solon.com!not-for-mail
  2. From: Stuart Stevens <stevens@corp.hp.com>
  3. Newsgroups: comp.lang.c,comp.lang.c.moderated,hp.unix,comp.sys.hp.apps,comp.sys.hp.hpux
  4. Subject: Re: C coding problem
  5. Date: 16 Mar 1996 11:20:14 -0600
  6. Organization: Corporate News Server
  7. Sender: clc@solutions.solon.com
  8. Approved: clc@solutions.solon.com
  9. Message-ID: <4iet8e$avl@solutions.solon.com>
  10. References: <4ianbf$h86@solutions.solon.com>
  11. NNTP-Posting-Host: solutions.solon.com
  12. X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.05 9000/715)
  13. X-Url: news:4ianbf$h86@solutions.solon.com
  14.  
  15. This is a multi-part message in MIME format.
  16.  
  17. ---------------------------------206301264331340
  18. Content-Transfer-Encoding: 7bit
  19. Content-Type: text/plain; charset=us-ascii
  20.  
  21. By any chance is "read_options" a pointer to char? 
  22.  
  23. option_val = read_options
  24.  
  25. ---------------------------------206301264331340
  26. Content-Transfer-Encoding: 7bit
  27. Content-Type: text/plain
  28.  
  29. From: proctor@corp.hp.com (Stephen Proctor)
  30. Newsgroups: comp.lang.c,comp.lang.c.moderated,hp.unix,comp.sys.hp.apps,comp.sys.hp.hpux
  31. Subject: C coding problem
  32. Date: 14 Mar 1996 21:14:55 -0600
  33. Organization: Corporate News Server
  34. Message-ID: <4ianbf$h86@solutions.solon.com>
  35.  
  36. Greetings,
  37.  
  38. I am trying to write a *simple* C program and am running into the following
  39. warning problem shown below.  Why do I get this warning?  
  40.  
  41. It seems to have an effect on the logic of the program when executed.
  42.  
  43. I am try to examine the first character in a command line argument, argv[],
  44. to the program for the presence of a "-" sign to identify the argument as
  45. an option.
  46.  
  47. Thanks for any help that can be sent my way.
  48.  
  49. Regards, Steve
  50.  
  51. Note: c89 is the HP-UX POSIX-conformant C compiler
  52.  
  53. Where can a list of warning and error codes be found for this compiler?
  54.  
  55. 1.) The following is the compilation line and the resulting warning message,
  56.  
  57. % c89 shell.c -o shell
  58. cc: "shell.c", line 98: warning 608: Illegal integer-pointer 
  59. combination in assignment.
  60.  
  61. 2.) The program is as follows,
  62.  
  63. #include <stdio.h>
  64. #include <ctype.h>
  65. #include <string.h>
  66. #include <stdlib.h>
  67.  
  68. main(int argc, char *argv[])
  69. {
  70. int ii;
  71. int option_val = 0;
  72. /* skip lines */
  73. for (ii=1; ii<argc; ii++) {
  74. /* skip lines */
  75. /* The next line is the offending line */
  76.    if (*argv[ii] == '-') option_val = read_options;
  77. /* skip lines */
  78. return 0;         /* Program executed successfully */
  79. }
  80.  
  81. ---------------------------------206301264331340--
  82.